Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Device Communications Messages


GXWriteData

QuickDraw GX sends the GXWriteData message to send data directly to the device, without buffering. You can override the GXWriteData message to provide your own I/O mechanism. Your override of the GXWriteData message must match the following formal declaration:

OSErr MyWriteData (Ptr data, long length);
data
A pointer to the data to send to device.
length
The number of bytes of data.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
The GXWriteData message sends unbuffered data to a device and waits for I/O to complete.

The default implementation of this message calls the asynchronous I/O functions of the Macintosh system software to send the data to the device. The default implementation then flushes the buffers, sends the resulting data through, and waits for the I/O operation to complete.

You can override this message as part of implementing your own I/O and buffering mechanism or changing how I/O is performed with your device.

SPECIAL CONSIDERATIONS
You can use the GXWriteData message yourself to send data to your device without buffering or to force the buffers to be flushed.

If you are implementing your own I/O mechanism, you need to totally override the GXWriteData message. If you are using the standard QuickDraw GX buffering and Macintosh I/O system, you must forward this message.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
The default implementation of the GXWriteData message can also return the communications errors that are listed in Table 4-2 on page 4-42.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help